import { http } from "@/utils/http";
import { baseUrlApi } from "../utils";

// 获取保障项目
export const ProProtectionGetPType = () => {
  return http.request<any>("get", baseUrlApi("/ProProtection/GetPType"));
};

// 保存保险设计
export const ProProtectionAddProProducts = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/ProProtection/AddProProducts"),
    { data }
  );
};

// 获取保险列表
export const ProProtectionGetProProducts = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/ProProtection/GetProProducts"),
    { data }
  );
};

// 查看保险列表详情
export const ProProtectionGetProject = (data: object) => {
  return http.request<any>("post", baseUrlApi("/ProProtection/GetProject"), {
    data
  });
};

// 获取数据整合客户群下拉框
export const ProRiskGetOption = () => {
  return http.request<any>("get", baseUrlApi("/ProRisk/GetOption"));
};

// 获取客户群体触发动作
export const ProActivityGetActivityTypes = (params: string) => {
  return http.request<any>(
    "get",
    baseUrlApi("/ProActivity/GetActivityTypes?" + params)
  );
};

// 新建活动
export const ProActivityInsertActivity = (data: object) => {
  return http.request<any>("post", baseUrlApi("/ProActivity/InsertActivity"), {
    data
  });
};

// 获取活动列表
export const ProActivityGetActivity = (data: object) => {
  return http.request<any>("post", baseUrlApi("/ProActivity/GetActivity"), {
    data
  });
};

// 启动活动or暂停活动
export const ProActivityStartSuspend = (data: object) => {
  return http.request<any>("post", baseUrlApi("/ProActivity/StartSuspend"), {
    data
  });
};

// 搜索数据整合列表
export const ProCustomGetProCustom = (data: object) => {
  return http.request<any>("post", baseUrlApi("/ProCustom/GetProCustom"), {
    data
  });
};

// 创建整合列表
export const ProCustomInsertCustomBase = (data: object) => {
  return http.request<any>("post", baseUrlApi("/ProCustom/InsertCustomBase"), {
    data
  });
};

// 获取客户群列表
export const ProCustomGetCustomHost = (params: string) => {
  return http.request<any>(
    "get",
    baseUrlApi("/ProCustom/GetCustomHost?" + params)
  );
};

// 提交新建风控模型
export const ProRiskInsert = (data: object) => {
  return http.request<any>("post", baseUrlApi("/ProRisk/Insert"), {
    data
  });
};

// 获取风控模型列表
export const ProRiskGetProRisk = (data: object) => {
  return http.request<any>("post", baseUrlApi("/ProRisk/GetProRisk"), {
    data
  });
};
// 获取保险产品列表
export const ProinsureGetProduct = () => {
  return http.request<any>("get", baseUrlApi("/Proinsure/GetProduct"));
};

//角色-投保人-申请投保 获取保险产品列表
export const ProProductsGetProProducts = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/ProProtection/GetProProducts"),
    {
      data
    }
  );
};

// 获取投保方案的投保名称列表
export const proinsureGetProduct = (params: string) => {
  return http.request<any>(
    "get",
    baseUrlApi("/proinsure/GetProduct?" + params)
  );
};

// 获取投保方案的详情列表
export const proinsureGetDetail = (params: string) => {
  return http.request<any>("get", baseUrlApi("/proinsure/GetDetail?" + params));
};

// 提交投保申请
export const ProinsureApplyInsure = (data: object) => {
  return http.request<any>("post", baseUrlApi("/Proinsure/ApplyInsure"), {
    data
  });
};

// 获取投保前风控-一键审核
export const proinsureOntouchUnder = (data: object) => {
  return http.request<any>("post", baseUrlApi("/proinsure/OntouchUnder"), {
    data
  });
};

// 获取投保前风控-获取投保列表
export const proinsureGetProInsure = (data: object) => {
  return http.request<any>("post", baseUrlApi("/proinsure/GetProInsure"), {
    data
  });
};

// 保费计算
export const ProProtectionFounPremiumCount = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/ProProtection/FounPremiumCount"),
    {
      data
    }
  );
};

// 获取保费计算产品列表
export const ProProtectionGetInsure = (data: object) => {
  return http.request<any>("post", baseUrlApi("/ProProtection/GetInsure"), {
    data
  });
};

// 保费计算数据回显
export const ProProtectionGetInsureDetails = (params: string) => {
  return http.request<any>(
    "get",
    baseUrlApi("/ProProtection/GetInsureDetails?" + params)
  );
};

// 获取OBD数据
export const ProProtectionGetOBDData = (data: object) => {
  return http.request<any>("post", baseUrlApi("/ProProtection/GetOBDData"), {
    data
  });
};

// h获取ODB保单
export const ProProtectionGetPINumber = (params: string) => {
  return http.request<any>(
    "get",
    baseUrlApi("/ProProtection/GetPINumber?" + params)
  );
};

// 新建授权
export const ProProtectionOBDDataEmpApply = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/ProProtection/OBDDataEmpApply"),
    {
      data
    }
  );
};

// 获取odb设备数据管理
export const ProOBDDataGetApplyInsure = (data: object) => {
  return http.request<any>("post", baseUrlApi("/ProOBDData/GetApplyInsure  "), {
    data
  });
};

// 获取授权 getcar = 2 的时候用
export const ProOBDDataObtainEmp = (data: object) => {
  return http.request<any>("post", baseUrlApi("/ProOBDData/ObtainEmp"), {
    data
  });
};

// 获取授权 getcar = 3 的时候用
export const ProOBDDataObtaAuth = (data: object) => {
  return http.request<any>("post", baseUrlApi("/ProOBDData/ObtaAuth"), {
    data
  });
};

// 获取授权 getcar = 4 的时候用
export const ProOBDDataDataAuth = (data: object) => {
  return http.request<any>("post", baseUrlApi("/ProOBDData/DataAuth"), {
    data
  });
};

//接收授权 getcar = 5 的时候用
export const ProOBDDataObtainEmpState = (data: object) => {
  return http.request<any>("post", baseUrlApi("/ProOBDData/ObtainEmpState"), {
    data
  });
};

//接收授权 getcar = 6 的时候用
export const ProProtectionGetCustomDetail = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/ProProtection/GetCustomDetail"),
    { data }
  );
};

//  obd健康数据
export const ProProtectionGetApplyHealth = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/ProProtection/GetApplyHealth"),
    {
      data
    }
  );
};

// 投保人-健康数据
export const ProProtectionGetApplysHealth = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/ProProtection/GetApplysHealth"),
    {
      data
    }
  );
};

// 申请获取健康数据 GetHealth = 0 || GetHealth = null
export const ProProtectionGetHealth = (data: object) => {
  return http.request<any>("post", baseUrlApi("/ProProtection/GetHealth"), {
    data
  });
};

// 申请获取健康数据 GetHealth = 1
export const ProProtectionEmpowerHealthData = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/ProProtection/EmpowerHealthData"),
    { data }
  );
};

// 投保决策 --我的投保-列表
export const ProFixPriceGetInsureList = (data: object) => {
  return http.request<any>("post", baseUrlApi("/ProFixPrice/GetInsureList"), {
    data
  });
};

// 投保决策结果
export const ProFixPriceInsureDeci = (data: object) => {
  return http.request<any>("post", baseUrlApi("/ProFixPrice/InsureDeci"), {
    data
  });
};

// 获取定价数据列表
export const ProFixPriceGetSearch = (data: object) => {
  return http.request<any>("post", baseUrlApi("/ProFixPrice/GetSearch"), {
    data
  });
};

export const ProFixPriceGetCarOBD = () => {
  return http.request<any>("get", baseUrlApi("/ProFixPrice/GetCarOBD"));
};

// TODO: 新增定价模型
export const ProFixPriceInsertFixPrice = (data: object) => {
  return http.request<any>("post", baseUrlApi("/ProFixPrice/InsertFixPrice"), {
    data
  });
};

// 获取保单
export const ProFixPriceGetInsure = (params: string) => {
  return http.request<any>(
    "get",
    baseUrlApi("/ProFixPrice/GetInsure?" + params)
  );
};
//获取出险次数 列表
export const proncdgetlist = () => {
  return http.request<any>("get", baseUrlApi("/proncd/getlist"));
};

// 获取保单详情
export const ProFixPriceGetDetail = (params: string) => {
  return http.request<any>(
    "get",
    baseUrlApi("/ProFixPrice/GetDetail?" + params)
  );
};

// TODO: 新增定价模型
export const profixpriceFixPrice = (data: object) => {
  return http.request<any>("post", baseUrlApi("/profixprice/FixPrice"), {
    data
  });
};

// 发送定价
export const profixpriceFixPriceSend = (params: string) => {
  return http.request<any>(
    "get",
    baseUrlApi("/profixprice/FixPriceSend?" + params)
  );
};

// 获取被保险人信息
export const ProProtectionGetAssured = (params: string) => {
  return http.request<any>(
    "get",
    baseUrlApi("/ProProtection/GetAssured?" + params)
  );
};

// 投保决策获取详情
export const ProFixPriceGetDeciDetail = (params: string) => {
  return http.request<any>(
    "get",
    baseUrlApi("/ProFixPrice/GetDeciDetail?" + params)
  );
};

// 返显客户群数据条件
export const ProcustomGetFX = (data: object) => {
  return http.request<any>("post", baseUrlApi("/Procustom/GetFX"), {
    data
  });
};
